package com.zhanghe.im.handler;

import com.zhanghe.im.response.MessageResponsePacket;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.util.Date;

/**
 * SimpleMessageResponseHandler
 *
 * @author Clevo
 * @date 2018/10/23
 */
public class SimpleMessageResponseHandler extends SimpleChannelInboundHandler<MessageResponsePacket> {

    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, MessageResponsePacket messageResponsePacket) throws Exception {
        System.out.println(new Date() + ": 收到["+messageResponsePacket.getFormUserId()+"]发送的消息: " + messageResponsePacket.getMessage());
    }
}
